<%@page import="java.util.List"%>
<%@page import="persistent.impl.ForumDAOImpl"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page  isELIgnored="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<% 
	ForumDAOImpl foimp =new ForumDAOImpl();
	List list =foimp.getForumListByPage("zhangjs", 1, 2);
	session.setAttribute("list", list);
 %>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSTL练习</title>
</head>
<body>
	<c:set var="value" scope="session" value="${'admin1' }"></c:set>
	<c:if test="${value=='admin' }">
		<p>管理员</p>
	</c:if>
	<c:if test="${value!='admin' }">
		<p>游客</p>
	</c:if>
	
	<c:set var="weekday" scope="session" value="${6 }"></c:set>
	<p>当前值为:<c:out value="${weekday }"></c:out></p>
	<c:choose>
		<c:when test="${weekday==1 }">
			<p>当前为星期一</p>
		</c:when>
		
		<c:when test="${weekday==2 }">
			<p>当前为星期二</p>
		</c:when>
		
		<c:when test="${weekday==3 }">
			<p>当前为星期三</p>
		</c:when>
		
		<c:when test="${weekday==4 }">
			<p>当前为星期四</p>
		</c:when>
		
		<c:when test="${weekday==5 }">
			<p>当前为星期五</p>
		</c:when>
		
		<c:when test="${weekday==6 || weekday==7 }">
			<p>当前为周末</p>
		</c:when>
		
		<c:otherwise>
			<p>什么都不是</p>
		</c:otherwise>
	</c:choose>
	
	

	<c:forEach items="${list }" var="obj">
		<p>【${obj.serilize}】${obj.topic }</p>
	</c:forEach>
</body>
</html>